/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Anamnesa.java
 *
 * Created on Oct 7, 2012, 3:41:24 PM
 */
package View;

import Controller.ControlData;
import Data.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;

/**
 *
 * @author a9uszT
 */
public class Anamnesa extends javax.swing.JFrame {

    /**
     * Creates new form Anamnesa
     */
    public Anamnesa() {
        initComponents();
        disableForm();
        enableEdit();
        GregorianCalendar gc = new GregorianCalendar();
        tanggal_periksa.setDate(gc.getTime());
        try {
            String kode = RekamMedis.idPetugasRM.getText();
            idPetugasTF.setText(kode);
        } catch (Exception ex) {
            Logger.getLogger(Anamnesa.class.getName()).log(Level.SEVERE, null, ex);
        }
        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        this.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                disable();
            }
        });
        String kodePasien = RekamMedis.noRM_TF.getText();
        idpasienTF.setText(kodePasien);
        idRM.setText(RekamMedis.otomatis_rm.getText());
        try {
            String nama = ControlData.NamaPasien(kodePasien);
            namaPasienTF.setText(nama);
            System.out.println(nama);
        } catch (Exception ex) {
            Logger.getLogger(Anamnesa.class.getName()).log(Level.SEVERE, null, ex);
        }

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        input_panel = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        idpasienTF = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        namaPasienTF = new javax.swing.JTextField();
        tanggal_periksa = new com.toedter.calendar.JDateChooser();
        jLabel8 = new javax.swing.JLabel();
        idPetugasTF = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        idRM = new javax.swing.JTextField();
        anamnesa_isi = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        anamnesa_textarea = new javax.swing.JTextArea();
        button_panel = new javax.swing.JPanel();
        simpan_button = new javax.swing.JButton();
        batal_btn = new javax.swing.JButton();
        edit_button = new javax.swing.JButton();
        exit_button = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setBackground(new java.awt.Color(51, 255, 255));
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        input_panel.setBackground(new java.awt.Color(0, 153, 255));

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel6.setText("idPasein");

        idpasienTF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                idpasienTFActionPerformed(evt);
            }
        });

        jLabel7.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel7.setText("namaPasien");

        namaPasienTF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                namaPasienTFActionPerformed(evt);
            }
        });
        namaPasienTF.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                namaPasienTFKeyReleased(evt);
            }
        });

        tanggal_periksa.setEnabled(false);

        jLabel8.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel8.setText("Tanggal");

        jLabel9.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel9.setText("idPetugas");

        jLabel10.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jLabel10.setText("idRM");

        idRM.setEnabled(false);
        idRM.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                idRMActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout input_panelLayout = new javax.swing.GroupLayout(input_panel);
        input_panel.setLayout(input_panelLayout);
        input_panelLayout.setHorizontalGroup(
            input_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(input_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(input_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(input_panelLayout.createSequentialGroup()
                        .addComponent(jLabel6)
                        .addGap(36, 36, 36)
                        .addComponent(idpasienTF, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(107, 107, 107)
                        .addComponent(jLabel9))
                    .addGroup(input_panelLayout.createSequentialGroup()
                        .addGroup(input_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel7)
                            .addComponent(jLabel10))
                        .addGap(18, 18, 18)
                        .addGroup(input_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(input_panelLayout.createSequentialGroup()
                                .addComponent(idRM, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addGroup(input_panelLayout.createSequentialGroup()
                                .addComponent(namaPasienTF, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addGap(18, 18, 18)
                .addGroup(input_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(idPetugasTF, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tanggal_periksa, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(129, Short.MAX_VALUE))
        );
        input_panelLayout.setVerticalGroup(
            input_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(input_panelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(input_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(idpasienTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9)
                    .addComponent(idPetugasTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(input_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(input_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel7)
                        .addComponent(namaPasienTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel8))
                    .addComponent(tanggal_periksa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(input_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(idRM, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(30, Short.MAX_VALUE))
        );

        getContentPane().add(input_panel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 170, 720, 130));

        anamnesa_isi.setBackground(new java.awt.Color(0, 153, 255));
        anamnesa_isi.setBorder(javax.swing.BorderFactory.createTitledBorder("Anamnesa"));

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel3.setText("isikan keluhan pasien");

        anamnesa_textarea.setColumns(20);
        anamnesa_textarea.setRows(5);
        jScrollPane1.setViewportView(anamnesa_textarea);

        javax.swing.GroupLayout anamnesa_isiLayout = new javax.swing.GroupLayout(anamnesa_isi);
        anamnesa_isi.setLayout(anamnesa_isiLayout);
        anamnesa_isiLayout.setHorizontalGroup(
            anamnesa_isiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(anamnesa_isiLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(anamnesa_isiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 688, Short.MAX_VALUE)
                    .addGroup(anamnesa_isiLayout.createSequentialGroup()
                        .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        anamnesa_isiLayout.setVerticalGroup(
            anamnesa_isiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(anamnesa_isiLayout.createSequentialGroup()
                .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        getContentPane().add(anamnesa_isi, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 300, 720, -1));

        button_panel.setBackground(new java.awt.Color(0, 153, 255));
        button_panel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        simpan_button.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        simpan_button.setText("Simpan");
        simpan_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                simpan_buttonActionPerformed(evt);
            }
        });
        button_panel.add(simpan_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 40, 107, 34));

        batal_btn.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        batal_btn.setText("Batal");
        batal_btn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                batal_btnActionPerformed(evt);
            }
        });
        button_panel.add(batal_btn, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 40, 107, 34));

        edit_button.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        edit_button.setText("Edit");
        edit_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                edit_buttonActionPerformed(evt);
            }
        });
        button_panel.add(edit_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 40, 100, 34));

        exit_button.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        exit_button.setText("Keluar");
        exit_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exit_buttonActionPerformed(evt);
            }
        });
        button_panel.add(exit_button, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 40, 110, 30));

        getContentPane().add(button_panel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 490, 720, 90));

        jPanel3.setBackground(new java.awt.Color(255, 255, 255));
        jPanel3.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 30)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("Sistem Informasi Rekam Medis");
        jPanel3.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 20, 490, 50));

        jLabel2.setBackground(new java.awt.Color(255, 255, 255));
        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
        jLabel2.setForeground(new java.awt.Color(255, 255, 255));
        jLabel2.setText("Poliklinik Sanata Dharma");
        jPanel3.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 70, -1, 28));

        jLabel11.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel11.setForeground(new java.awt.Color(255, 255, 255));
        jLabel11.setText("Jl. paingan, Maguwoharjo");
        jPanel3.add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 110, -1, -1));

        jLabel12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/picture/usd.gif"))); // NOI18N
        jPanel3.add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 150, 140));

        jLabel13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/picture/Vista_Blue_Withoutlogo_1600x1200.jpg"))); // NOI18N
        jLabel13.setText("jLabel10");
        jPanel3.add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 720, 170));

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 720, Short.MAX_VALUE)
            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup()
                    .addGap(0, 0, Short.MAX_VALUE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, Short.MAX_VALUE)))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 170, Short.MAX_VALUE)
            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup()
                    .addGap(0, 0, Short.MAX_VALUE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, Short.MAX_VALUE)))
        );

        getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));

        pack();
        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        java.awt.Dimension dialogSize = getSize();
        setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
    }// </editor-fold>//GEN-END:initComponents

    private void namaPasienTFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_namaPasienTFActionPerformed
    }//GEN-LAST:event_namaPasienTFActionPerformed

    private void batal_btnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_batal_btnActionPerformed
        empty();
    }//GEN-LAST:event_batal_btnActionPerformed

    private void simpan_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_simpan_buttonActionPerformed
        if (anamnesa_textarea.getText().equalsIgnoreCase("")) {
            JOptionPane.showMessageDialog(rootPane, "Anamnesa masih Kosong\n Harap diisi dahulu",
                    "Error Anamnesa Kosong", JOptionPane.ERROR_MESSAGE);
        } else {
            String idpas = idRM.getText();
            String isiAnamnesa = anamnesa_textarea.getText();
            String idpetugas = idPetugasTF.getText();
            Date tgl = tanggal_periksa.getDate();
            SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yy");
            String tglperiksa = sdf.format(tgl);
            RekamMedisData RMD = new RekamMedisData();
            Pegawai peg = new Pegawai();
            peg.setIdPegawai(idpetugas);
            RMD.setIdRekamMedis(idpas);
            RMD.setAnamnesa(isiAnamnesa);
            RMD.setTanggal_RM(tglperiksa);
            RMD.setPetugas(peg);
            if (simpan_button.getText().startsWith("S")) {
                try {
                    ControlData.input(new RekamMedisData(idpas,tglperiksa, isiAnamnesa, "", "", peg, null, null,null));
                    JOptionPane.showMessageDialog(rootPane, "sukses masuk");
                    parent.tampilTableRM();
                    disableEdit();
                } catch (Exception ex) {
                    JOptionPane.showMessageDialog(rootPane, "error :" + ex.getMessage());
                    Logger.getLogger(Anamnesa.class.getName()).log(Level.SEVERE, null, ex);
                }
            } else {
                try {
//                    ControlData.getKoneksi().updateRMAnamnesa(RMD);
                    JOptionPane.showMessageDialog(rootPane, "sukses update");
                    disableEdit();
                    parent.tampilTableRM();
                    simpan_button.setText("Simpan");
                    RekamMedis rm = new RekamMedis();
                    rm.tampilTableRM();
                } catch (Exception ex) {
                    JOptionPane.showMessageDialog(rootPane, "error :" + ex.getMessage());
                    Logger.getLogger(Anamnesa.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }
        parent.tampilTableRM();
        RekamMedis.diagnosa_button.setEnabled(false);
    }//GEN-LAST:event_simpan_buttonActionPerformed

    private void idpasienTFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_idpasienTFActionPerformed
    }//GEN-LAST:event_idpasienTFActionPerformed

    private void edit_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_edit_buttonActionPerformed
        enableEdit();
        simpan_button.setText("update");
    }//GEN-LAST:event_edit_buttonActionPerformed

    private void exit_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exit_buttonActionPerformed
        JOptionPane.showMessageDialog(rootPane, "selesai ");
        dispose();
        disable();
    }//GEN-LAST:event_exit_buttonActionPerformed

    private void namaPasienTFKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_namaPasienTFKeyReleased
    }//GEN-LAST:event_namaPasienTFKeyReleased

    private void idRMActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_idRMActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_idRMActionPerformed

    private void empty() {
        idpasienTF.setText("");
        namaPasienTF.setText("");
        anamnesa_textarea.setText("");
    }

    private void enableEdit() {
        anamnesa_textarea.setEditable(true);
        anamnesa_textarea.setEnabled(true);
    }

    private void disableEdit() {
        anamnesa_textarea.setEditable(false);
        anamnesa_textarea.setEnabled(false);

    }

    @Override
    public void disable() {
        Menuowner.setEnabled(true);
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Windows".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Menu_Utama.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Menu_Utama.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Menu_Utama.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Menu_Utama.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new Anamnesa().setVisible(true);
            }
        });
    }
    private RekamMedis Menuowner;
    private RekamMedis parent;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel anamnesa_isi;
    private javax.swing.JTextArea anamnesa_textarea;
    private javax.swing.JButton batal_btn;
    private javax.swing.JPanel button_panel;
    private javax.swing.JButton edit_button;
    private javax.swing.JButton exit_button;
    private javax.swing.JTextField idPetugasTF;
    private javax.swing.JTextField idRM;
    private javax.swing.JTextField idpasienTF;
    private javax.swing.JPanel input_panel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField namaPasienTF;
    private javax.swing.JButton simpan_button;
    private com.toedter.calendar.JDateChooser tanggal_periksa;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the Menuowner
     */
    public RekamMedis getMenuowner() {
        return Menuowner;
    }

    /**
     * @param Menuowner the Menuowner to set
     */
    public void setMenuowner(RekamMedis Menuowner) {
        this.Menuowner = Menuowner;
    }

    private void disableForm() {
        idPetugasTF.setEditable(false);
        idPetugasTF.setEnabled(false);
        idpasienTF.setEditable(false);
        idpasienTF.setEnabled(false);
        namaPasienTF.setEditable(false);
        namaPasienTF.setEnabled(false);
    }

    /**
     * @param parent the parent to set
     */
    public void setParent(RekamMedis parent) {
        this.parent = parent;
    }
}
